<style>
#evidencijaDolazaka{
	width:1000px;
	overflow:auto;
}
#evidencijaDolazaka input[type=submit]{
	float:right;
}

#evidencijaDolazaka table#evidencijaMainTable{
	border:2px outset #ccc;
	background:#ccc;
}
#evidencijaDolazaka table{
	width:100%;
}
#evidencijaDolazaka table tr.head td{
	text-transform:uppercase;
}
#evidencijaDolazaka table tr td{
	vertical-align:top;
}
#evidencijaDolazaka table tr td select,
#evidencijaDolazaka table tr td input[type=text],
#evidencijaDolazaka table tr td textarea{
	background:#eee;
	border:1px solid #ddd;
}
#evidencijaDolazaka table tr td select:focus,
#evidencijaDolazaka table tr td input[type=text]:focus,
#evidencijaDolazaka table tr td textarea:focus{
	background:#fff;
	border:1px solid #000;
}
#evidencijaDolazaka table tr td textarea{
	width:200px;
	height:14px;
}
#evidencijaDolazaka table tr td textarea:focus{
	height:80px;
	position:absolute;
}
#evidencijaDolazaka table tr td input[type=button]{
	background-position:center center;
	padding:0px;
	width:18px;
	height:18px;
}
#evidencijaDolazaka .label{
	display:block;
	float:left;
	padding-top:8px;
}
#evidencijaDolazaka input.satmin{
	width:18px;
}
#evidencijaDolazaka #message{
	float:right;
	max-width:400px;
	max-height:75px;
	overflow:hidden;
	text-align:right;
	color:#fff;
	background:#f00;
	padding:5px;
	display:none;
}
</style>
<div class="area" id="evidencijaDolazaka">
<h1>Evidencija dolazaka/odlazaka radnika</h1>
<form method="post" action="javascript:void(0)" onsubmit="submitForm(this,'evidencija.php','POST','afterSaveEvidencijaDolazaka',1)">
	<input type="hidden" name="nongui" value="1" />
	<input type="hidden" name="a" value="save" />
	<input type="hidden" name="length" value="1" />
    
    <label class="left" for="date">Datum:</label>
    <input type="text" name="date" id="date" size="7" maxlength="10" />
    <input type="button" class="datePicker" onclick="displayDatePicker('date',this)" />
    <br clear="all" />
    
    
    <table id="evidencijaMainTable">
    	<tr class="head" align="center">
			<td>#</td>
        	<td>radnik</td>
            <td>došao</td>
            <td>otišao</td>
			<td width="150">odsutan</td>
			<td>opr.</td>
            <td width="220">napomena</td>
            <td width="60">&nbsp;</td>
        </tr>
        <tr>
			<td>1</td>
        	<td>
                <select name="radnik_1" id="radnik_1">
                    <option value="-1">---</option>
                    {{%loop start radnik_id}}
                    <option value="{{$radnik_id}}">{{$radnik_ime}}&nbsp;{{$radnik_prezime}}</option>
                    {{%loop end}}
                </select>
			</td>
			<td>
				<span class="label">sat:</span><input onkeyup="evidencijaVremeNext(event,this)" type="text" class="satmin" name="time_in_H_1" id="time_in_H_1" maxlength="2" />
				<span class="label">minut:</span><input type="text" class="satmin" name="time_in_M_1" id="time_in_M_1" maxlength="2" />
			</td>
			<td>
				<span class="label">sat:</span><input onkeyup="evidencijaVremeNext(event,this)" type="text" class="satmin" name="time_out_H_1" id="time_out_H_1" maxlength="2" />
				<span class="label">minut:</span><input type="text" class="satmin" name="time_out_M_1" id="time_out_M_1" maxlength="2" />
			</td>
			<td align="center">
				<input type="checkbox" name="nonpresent_1" id="nonpresent_1" onchange="var sel=this.nextSibling.nextSibling; if(this.checked){sel.style.display='block'}else{sel.style.display='none'; sel.selectedIndex=0;}" />
				<select name="opravdanje_1" id="opravdanje_1" style="display:none;">
					<option value="0">---</option>
					{{%loop start opravdanje_id}}
					<option value="{{$opravdanje_id}}">{{$opravdanje_name}}</option>
					{{%loop end}}
				</select>
			</td>
			<td><input type="checkbox" name="opravdano_1" id="opravdano_1" /></td>
			<td><textarea name="napomena_1" id="napomena_1"></textarea></td>
			<td>
				<input type="button" class="novi" onclick="evidencijaNewRow(this)" />
				<input type="button" class="delete" onclick="evidencijaDeleteRow(this)" />
			</td>
        </tr>
    </table>
    
    <br clear="all" />
	<input type="submit" value="sačuvaj" class="save" />
</form>

</div>
<script>
var fo = document.getElementById("radnik_0");
if(fo){
	fo.focus();
}
</script>